The Server Restart Option™ (SRO) enables new capabilities in PowerKey® Pro which make it easier to restart servers after crashes. An SRO-enabled PowerKey Pro can also monitor a custom application (such as a database or multimedia presentation) via Apple Events, and restart if it fails. Finally, the SRO enables you to create a log of your Events to let you know when they execute.
The SRO is available directly from Sophisticated Circuits, and costs $39.95. You can order by phone at 1-800-769-3773, by e-mail at sales@sophisticated.com, or by mail at 19017 120th Ave NE, Suite 106, Bothell WA 98011. You will receive an “activator code” that will allow the SRO to activate these features in your PowerKey Pro.
Note: For e-mail and mail orders, you must include the serial number of your PowerKey Pro.
________________________________
How to Install
1. Double-click on the Installer in the “PowerKey®” master disk (or folder, if you downloaded the updater).
2. Select “Custom Install” from the pop-up menu at the top left of the installer window.
3. Check the “PowerKey Pro 200 Server Restart Option” box.
4. Enter your activator code into the dialog box that appears.
3. Restart your system normally.
Note: If the “Server Restart Option” item does not appear in the Installer, make sure that a PowerKey Pro unit is connected to the computer, and that the SRO has not already been installed on that unit. Once a unit has been upgraded, there is no need to ever re-install the SRO.
The installer will modify your PowerKey Pro unit to activate the SRO features. Your unit will retain this ability even if you move it to another computer in the future.
________________________________
What’s in the SRO
New ”When System Crashes” Trigger
This Trigger occurs when PowerKey Pro decides that the computer has crashed. This allows you to create an Event which will automatically restart a computer when it crashes, without having to use a Repeating Trigger.
The PowerKey software normally “pings” the hardware every ten seconds. If the computer crashes, this pinging will stop. The PowerKey Pro hardware waits a user-settable amount of time, then executes any Event that has this Trigger.
You can control how long PowerKey Pro will wait in the Preferences dialog box. This value can be set to anything between 30 and 1020 seconds on Model 200, and between 30 and 65535 seconds on Model 600. Do not set this timer too short, or your system may restart during long operations such as spreadsheet recalculations or file copies.
In addition, the How Started Qualifier now includes a “System Crash” option which lets you run an Event only if the system was last started by a “When System Crashes” Event.
New “When Timer Expires” Trigger
There is a new “When Timer Expires” Trigger, and an internal “User Timer” for use by a custom application. This timer is set from AppleScript or via an Apple Event, and immediately starts counting down seconds. When it reaches 0, any Event with a “When Timer Expires” Trigger will be executed.
This feature is useful for kiosks and other systems running custom software. You can create an Event to restart the computer when the Timer expires, and your software can repeatedly set this value when it runs. If it stops running for some reason, your computer will automatically restart!
If you aren’t running AppleScript due to memory constraints, you can set the timer from a simple Apple Event. Use the event class ‘PKPr’, the event ID ‘Tick’, and put the timer value (in seconds) into the direct object.
Note: This feature works only in the PowerKey software. If the computer crashes, no Timer Events will be executed. To restart a computer when it crashes, see the section describing the “When System Crashes” Trigger above.
New “System Running” Qualifier
This Qualifier restricts the Trigger to activate only if the computer is (or is not) running normally.
If the “is/is not” pop-up menu is set to “is,” the Qualifier is true when the computer is running normally. If it is set to “is not,” the Qualifier is true when the computer is turned off, or if has crashed, or if the PowerKey software is not running.
NOTE: PowerKey Pro will only decide that a computer is not running after the Crash Detection Timer reaches zero. Until then, no Events with a System Is Not Running Qualifier will be executed.
TIP: This Qualifier is primarily useful for making sure Events only run when the computer is crashed. For example, you can create an Event which will restart your computer when the phone rings, but not if it’s running normally.
New “Add to Log” Action
The PowerKey software can now maintain a log file of your Events, which can help you see, for example, when your computer crashes or a phone call was detected. The new “Add to Log” Action creates a text file in your PowerKey Folder named “PowerKey Log”. You can write a brief message when you create an “Add to Log” Action, and the PowerKey software will add this message, along with the current date and time, to the PowerKey Log.
You can control the maximum size of the PowerKey Log in the “Preferences” dialog box of the PowerKey Editor. If the file grows larger than this size, the topmost (oldest) entries are removed.
Miscellaneous Improvements
• There is a new “Force Restarts” check box in the Preferences dialog box. If this box is checked, and the PowerKey software initiates a Restart Action, it now leaves the crash detection timer running. If the computer crashes during the restart, a “When System Crashes” triggered Event can now force a hardware restart.
________________________________
Designing a Restart Strategy
An SRO-enabled PowerKey Pro gives you a powerful set of tools that can be used in a variety of ways. The best way to ensure that your system stays up and running is to attack the problem from several fronts. This appendix describes several example Events that you can mix, match and modify to form a coordinated restart strategy.
Automatic Restarts
Crash Restart
One of the most powerful uses of the SRO is also the simplest.
Trigger: When System Crashes
Action: Restart
This Event will cover most situations where the system comes to a complete halt.
TIP: If your server does not run 24 hours a day, you can add a Time Range Qualifier to this Event.
Restarting after a Power Failure
To automatically start up your computer after a power failure, create this Event:
Trigger: When Power Returns
Action: Start Up Computer
PowerKey Pro will sense when power returns and automatically start up your computer.
Telephone Control
Restarting with a Phone Call
There may be times when the system isn’t completely crashed, but you need to “manually” restart it remotely. If you have a phone line connected to PowerKey Pro, this Event lets you restart the computer with a phone call.
Trigger: When Phone Rings
Action: Restart
Be sure to set the number of rings high, to keep wrong numbers from inadvertently restarting your computer.
TIP: PowerKey Pro also works with the “distinctive ringing” phone service, which can allow you to use the same phone line for remote access and remote restarts.
TIP: If you wish to use a phone call to restart a computer only if it has crashed, you can add a System (Is Not) Running Qualifier to this Event. This is useful if you share a phone line on a desktop Mac, and don't want to be restarted while your computer is running normally.
Other Features
Dealing with File Sharing
If a user is connected to your computer with File Sharing when an Event is attempting to shut down or restart it, a dialog box will appear asking when you wish to shut down. This dialog box will interrupt the shut down process, and utilities like Keep It Up! can’t automatically dismiss it.
You can solve this problem by creating an AppleScript™ to turn off File Sharing, and running it from your Events before shutting down or restarting.
tell application "Finder"
set file sharing to false
end tell
NOTE: The “Stop File Sharing” AppleScript included with the Mac® OS software will not work for this, since it displays its own dialog box when it runs.
To use this AppleScript, save it in the Script Editor as a “compiled script.” Edit any Events that shut down or restart the computer, and place an Execute Script Action before the Shut Down Computer or Restart Actions. It may also be a good idea to place a Wait Action in the middle, to make sure that the script is finished before attempting to shut down or restart.
Monitoring Custom Applications
Custom applications, such as databases or interactive presentations, can “ping” the PowerKey software in much the same way that the PowerKey software pings the hardware. You can use the When Timer Expires Trigger to restart the system when your application crashes or otherwise fails to respond.
You must design your application to periodically send an Apple Event to the PowerKey software, telling it to set the User Timer to, for example, 300 seconds. When your application stops resetting the User Timer, it will continue counting down. If the User Timer reaches zero, this Event will restart the system. See “Scripting the PowerKey” in the “Extras” folder on the PowerKey Pro master disk for more information on Apple Events and AppleScript.
The files in this package may not be redistributed in any way without express permission from Sophisticated Circuits, Inc.
PowerKey is a registered trademark, and Server Restart Option is a trademark of Sophisticated Circuits, Inc. Mac and AppleScript are registered trademarks of Apple Computer, Inc.